package com.study.testSSMPlus.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.study.testSSMPlus.entity.Student;
import com.study.testSSMPlus.service.IStudentService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wuyu
 * @since 2019-12-19
 */
@Controller
@RequestMapping("/student")
public class StudentController {
	
	@Autowired
	private IStudentService studentService;
	
	@ResponseBody
	@GetMapping("/list")
	public PageInfo<Student> list(){
		PageHelper.startPage(0, 5);
		List<Student> list = studentService.list();
		PageInfo<Student> pageInfo = new PageInfo<>(list);
		return pageInfo;
	}
}

